home *** CD-ROM | disk | FTP | other *** search
- /*
- * $Id: snap_container_test.java,v 1.11 1996/10/03 19:46:51 hudson Exp $
- * $Author: hudson $
- */
-
- package sub_arctic.test;
-
- import sub_arctic.lib.interactor;
- import sub_arctic.lib.interactor_applet;
- import sub_arctic.lib.manager;
- import sub_arctic.lib.top_level;
- import sub_arctic.lib.snap_container;
- import sub_arctic.lib.point_snap_target;
- import sub_arctic.lib.icon;
- import sub_arctic.lib.button;
- import sub_arctic.lib.oneline_text_edit;
- import sub_arctic.lib.base_parent_interactor;
- import sub_arctic.output.style_manager;
- import sub_arctic.output.style;
- import sub_arctic.output.drawable;
- import sub_arctic.output.loaded_image;
- import java.awt.Color;
-
- public class snap_container_test extends interactor_applet {
-
- /**
- * Shorthand for generating a button's image in the default style.
- */
- public static loaded_image[] std_label(String s) {
- style st=style_manager.current_style();
- return st.button_make_images(s,style_manager.default_font(),10,5,false);
- }
-
- public void build_ui(base_parent_interactor top)
- {
- interactor p1;
- loaded_image[] lab1;
-
- lab1 = std_label("Snap drag me...");
- p1 = new snap_container(10,10,false);
- top.add_child(p1);
- p1.add_child(new icon(0,0,lab1[0]));
-
- for (int px = 50; px < top.w(); px += 100)
- for (int py = 50; py < top.h(); py += 50)
- top.add_child(new target(px, py));
-
- top.add_child(new oneline_text_edit(315,325,200,"interference test",
- null, true));
- }
- }
-
- class target extends point_snap_target {
- public target(int xv, int yv) {super(xv,yv);}
- public void draw_self_local(drawable d)
- {
- d.setColor(Color.blue);
- d.fillRect(0,0,2,2);
- }
- }
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-